<?php

	if (isset($_GET["set"]))
		{
			$nombre_exc=$_GET["n"];
			$dbHost = "localhost";
			$dbUser = "root";
			$dbPass = "root";
			$dbDatabase = "piaimu";
			$query="SELECT id_excursion, nombre_exc FROM excursion WHERE (nombre_exc LIKE '%$nombre_exc%');";

			$link_buscarExcursiones = mysqli_connect($dbHost,$dbUser,$dbPass);
			mysqli_select_db($link_buscarExcursiones,$dbDatabase);
			$excursiones=mysqli_query($link_buscarExcursiones,$query);

			echo "<script type='text/javascript'>document.getElementById('form_buscarExcursion').style.display='none';</script>";
			echo "<script type='text/javascript'>document.getElementById('tbl_resultados').style.display='block';</script>";
			echo "<script type='text/javascript'>document.getElementById('btn_volver').style.display='block';</script>";
			echo "<script type='text/javascript'>document.getElementById('h3_mensaje').innerHTML='Resultados';</script>";
			while($excursion = mysqli_fetch_array($excursiones))
			{
				echo "<script type='text/javascript'>var newrow=document.createElement('TR');</script>";
				echo "<script type='text/javascript'>var newcell=document.createElement('TD');</script>";
				echo "<script type='text/javascript'>newcell.innerHTML='$excursion[0]';</script>";
				echo "<script type='text/javascript'>newrow.appendChild(newcell);</script>";
				echo "<script type='text/javascript'>newcell=document.createElement('TD');</script>";
				echo "<script type='text/javascript'>newcell.innerHTML='$excursion[1]';</script>";
				echo "<script type='text/javascript'>newrow.appendChild(newcell);</script>";
				echo "<script type='text/javascript'>document.getElementById('tbl_resultados').appendChild(newrow);</script>";
/*
				echo "<script type='text/javascript'></script>";
				echo "<script type='text/javascript'></script>";
				echo "<script type='text/javascript'></script>";
				echo "<script type='text/javascript'></script>";
				echo "<script type='text/javascript'></script>";
				echo "<script type='text/javascript'></script>";
*/
			}


		}

?>
